#!/usr/bin/env node
const program = require('commander')
const chalk = require('chalk')
const logSymbols = require('log-symbols')
const ora = require('ora')
const inquirer = require('inquirer')
const downloadGit= require('./downloadGit.js')
program
    .version(`Version is ${require('./package.json').version}`)
    .description('A simple CLI for building initialize project include Wechat applet, Vue, Egg (nodejs)')
    .usage('<command> [options]')
    .command('create')
    .action((name, cmd) => {
    	console.log(logSymbols.success,chalk.red("this's green text,do you love this?"))
    })
    .parse(process.argv)

// const spinner= ora("下载文案")
// spinner.start()
// setTimeout(()=>{
//     spinner.succeed()
// },1000)


// 和用户交互
inquirer.prompt([
    {
        name: 'projectName',
        message: '是否测试拉取Git(y/n)',
        default: 'n',
    },
]).then((res) => {
    if(res.projectName== 'y'){
        downloadGit("git@gitee.com:lilongxian/cube_demo.git","style_lala/cube_demo")
    }
})